package com.wxlsoft.excel.convert.model;

import java.util.LinkedList;
import java.util.List;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 报文数据
 * @author wangxiaoliang
 */
@Getter
@ToString
public class ServicePackage {
	
	/**
	 * sheet名称
	 */
	private String sheetName;	
	
    /**
     * 报文头
     */
	@Setter
    private ServiceHead head = new ServiceHead();
	
    /**
     * 报文输入
     */
    private List<ServiceBody> inputs = new LinkedList<>();
	
    /**
     * 报文输出
     */
    private List<ServiceBody> outputs = new LinkedList<>();

	/**
	 * 是否是标准报文
	 */
	private Boolean isStandard;

	public ServicePackage() {}
	
	public ServicePackage(String sheetName, boolean isStandard) {
		this.sheetName = sheetName;
		this.isStandard = isStandard;
	}

	public void addServiceBodyInput(ServiceBody bodyInput) {
		if (bodyInput.isNotEmpty())
			inputs.add(bodyInput);
	}
	
	public void addServiceBodyOutput(ServiceBody bodyOutput) {
		if (bodyOutput.isNotEmpty())
			outputs.add(bodyOutput);
	}

}
